package 基础篇.线程通信.同步锁通信;


/**
 * @author IBM CHEN ZHI KAN
 * @create 2018/7/28
 */
public class DrawThread extends Thread{
  private Account account;
  private double drawAmount;
  public DrawThread(String name, Account account, double drawAmount){
    super(name);
    this.account=account;
    this.drawAmount=drawAmount;
  }
  public void run(){
    while (true){
      account.draw(drawAmount);
      try {
        Thread.sleep(1000l);
      } catch (InterruptedException e) {
        e.printStackTrace();
      }
    }
  }
}
